from django.contrib import admin
from . import models
from django_markdown.admin import MarkdownModelAdmin
from django_markdown.widgets import AdminMarkdownWidget
from django.db.models import TextField

# Register your models here.
#admin.site.register(Article)
class ArticleAdmin(MarkdownModelAdmin):
    list_display = ("title","date_time","read_count")
    content = {TextField: {'widget': AdminMarkdownWidget}}

class TagAdmin(admin.ModelAdmin):
    list_display = ("name","description")
    
class CategoryAdmin(admin.ModelAdmin):
    list_display = ("name","description")
    
admin.site.register(models.Tag,TagAdmin)
admin.site.register(models.Category,CategoryAdmin)
admin.site.register(models.Article, ArticleAdmin)
admin.site.register(models.BaseInformation)
admin.site.register(models.FriendlyLink)


